package com.sr.aspect;

import org.aspectj.lang.ProceedingJoinPoint;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;

/**
 * @author xiaochi
 * @date 2022/4/30 14:22
 * @desc AbstractAspect
 */
public abstract class AbstractAspect<T> implements Aspect<T> {

    /**
     * 执行
     * @param joinPoint
     * @param method
     * @param request
     * @return
     */
    @Override
    public Object doHandlerAspect(ProceedingJoinPoint joinPoint, Method method, HttpServletRequest request) {
        return this.execute(joinPoint,method,request);
    }

    /**
     * 抽象方法（需要具体实现）
     * @param joinPoint
     * @param method
     * @param request
     * @return
     */
    protected abstract Object execute(ProceedingJoinPoint joinPoint, Method method, HttpServletRequest request);
}
